<!--
描述：试题检测信息组件
开发人：hqj
开发日期：2018年11月09日
修改人：
修改日期：
-->
<template lang="pug">
    div.kalix-article(v-if="pageShow")
        keep-alive
            kalix-table(bizKey="questionsTesting" title='试题检测信息列表' v-bind:targetURL="questionTestingURL"
            v-bind:bizSearch="'QuestionsTestingSearch'" v-bind:toolbarBtnList="toolbarBtnList"
            v-bind:btnList="btnList" v-bind:isFixedColumn="isFixedColumn" ref="kalixTable")
                template(slot="tableColumnSlot")
                    el-table-column(prop="subTypeName" label="题型子类" align="center" width="180px")
                    el-table-column(prop="typeName" label="试题类别" align="center" width="150px")
                    el-table-column(prop="questionId" label="ID" align="center" width="80px")
                    el-table-column(prop="stem" label="题干" align="center" width="350px")
                        template(slot-scope="scope")
                            el-popover(trigger="hover" placement="top" width="350")
                                | {{scope.row.stem}}
                                div(slot="reference")
                                    template(v-if="scope.row.stem && scope.row.stem.length > 20")
                                        | {{scope.row.stem.substr(0, 20)}}...
                                    template(v-else)
                                        | {{scope.row.stem}}
                    el-table-column(prop="createBy" label="创建者" align="center" width="120px")
                    el-table-column(prop="creationDate" label="创建时间" align="center" width="180px")
                        template(slot-scope="scope")
                            i(class="el-icon-time")
                            span {{scope.row.creationDate}}
                    el-table-column(prop="delFlag" label="删除状态" align="center" width="120px")
                        template(slot-scope="scope")
                            template(v-if="scope.row.delFlag === '0'")
                                el-tag(type="success") 有效
                            template(v-else)
                                el-popover(trigger="hover" placement="top" width="120")
                                    | 试题删除原因
                                    br
                                    | {{scope.row.reason}}
                                    div(slot="reference")
                                        el-tag(type="danger") 已删除
                    el-table-column(prop="compareFlag" label="排重比对状态" align="center" width="120px")
                        template(slot-scope="scope")
                            template(v-if="scope.row.compareFlag === '1'")
                                el-tag(type="success") 已比对
                            template(v-else)
                                el-tag(type="danger") 未比对
                    el-table-column(prop="repeatedFlag" label="排重处理状态" align="center" width="120px")
                        template(slot-scope="scope")
                            template(v-if="scope.row.repeatedFlag === '1'")
                                el-tag(type="success") 已处理
                            template(v-else)
                                el-tag(type="danger") 未处理
                    el-table-column(prop="checkFlag" label="审核状态" align="center" width="120px")
                        template(slot-scope="scope")
                            template(v-if="scope.row.checkFlag === '1'")
                                el-tag(type="success") 已通过
                            template(v-else-if="scope.row.checkFlag === '2'")
                                el-popover(trigger="hover" placement="top" width="120")
                                    | 审核未通过原因
                                    br
                                    | {{scope.row.checkReason}}
                                    div(slot="reference")
                                        el-tag(type="danger") 未通过
                            template(v-else)
                                el-tag 未审核
                    el-table-column(prop="checker" label="审核员" align="center" width="120px")
                    el-table-column(prop="checkDate" label="审核时间" align="center" width="180px")
                        template(slot-scope="scope")
                            i(class="el-icon-time")
                            span {{scope.row.checkDate}}
    div(v-else) 题库功能已关闭，如需使用请联系管理员！
</template>

<script type="text/ecmascript-6">
    import {QuestionTestingURL} from '../../config.toml'
    /*import {availableQuestion} from '../../common.js'*/

    export default {
        name: 'kalix-enrolment-questionstesting',
        data() {
            return {
                pageShow: false,
                toolbarBtnList: [
                    {id: 'add', isShow: false}
                ],
                btnList: [],
                questionTestingURL: QuestionTestingURL,
                isFixedColumn: true
            }
        },
        components: {},
        created() {
            /*availableQuestion(this.axios, this.$KalixMessage, flag => {
             this.pageShow = flag
             })*/
            this.pageShow = true
        },
        activated() {
        },
        deactivated() {
        },
        watch: {},
        methods: {}
    }
</script>

<style scoped lang="stylus">
</style>
